home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Apps
/
Utilities
/
Unix
/
CommandMon
/
UNIXobject.m
< prev
Wrap
Text File
|
1992-12-26
|
562b
|
35 lines
#import "UNIXobject.h"
#import <streams/streams.h>
#import <dpsclient/dpsclient.h>
#import <stdio.h>
@implementation UNIXobject
- execute:(char *)theCommand
{
NXStream *theStream;
FILE *fp;
fp=popen(theCommand,"r");
theStream=NXOpenFile(fileno(fp),NX_READONLY);
if (delegate && [delegate respondsTo:@selector(returnOutput:)])
[delegate perform:@selector(returnOutput:)
with:(void *)theStream];
NXClose(theStream);
pclose(fp);
return self;
}
- setDelegate:anObject
{
delegate=anObject;
return self;
}
- delegate
{
return delegate;
}
@end